import { setHabit } from "../../utils/localStorageData";

const state = {
  habit: {}
}

const mutations = {
  SET_HABIT: (state, habit) => {
    state.habit = habit
  },
}

const actions = {
  // 设置用户习惯
  setHabitSetting({ commit }, habit) {
    commit('SET_HABIT', habit)
    setHabit(habit)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
